package org.grow.prac.controller;

import org.grow.prac.service.CodeGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xwg
 * @CreateDate: 2023/10/9
 */

@RestController
@RequestMapping("/prac/codegen")
public class CodeGeneratorController {
    @Autowired
    private CodeGenerator codeGenerator;

    @GetMapping("/nextCode")
    public String nextCode(@RequestParam("code") String code) {
        return codeGenerator.nextCode(code);
    }
}
